home *** CD-ROM | disk | FTP | other *** search
-
- hlsl("
-
- sampler Image: register(s0);
- sampler HatchTex: register(s1);
-
- static const half4 H0 = {1, 0, 0, 0};
- static const half4 H1 = {0, 1, 0, 0};
- static const half4 H2 = {1, 1, 0, 0};
- static const half4 H3 = {0, 0, 1, 0};
- static const half4 H4 = {0, 0, 0, 1};
- static const half4 H5 = {0, 0, 1, 1};
- static const half4 H6 = {1, 1, 1, 1};
-
- half4 main(half2 texCoord0: TEXCOORD0,
- half2 texCoord1: TEXCOORD1) : COLOR {
-
-
- half4 Color = tex2D( Image, texCoord0);
- half4 AllHatch = tex2D( HatchTex, texCoord1);
- half Lum = dot( Color.rgb, half3( 0.33, 0.33, 0.33))*4;
- int step = Lum*8;
-
- half level0 = saturate(half(step)-0.875*8);
- half hatch0 = 1 - AllHatch.x; // 1-dot(AllHatch, H0);
- half Hatch = lerp( hatch0, 1, level0 );
-
- half level1 = saturate(half(step)-0.75*8);
- half hatch1 = 1- AllHatch.y; // 1-dot(AllHatch, H1);
- Hatch = lerp( hatch1, Hatch, level1 );
-
- half level2 = saturate(half(step)-0.625*8);
- half hatch2 = 1-dot(AllHatch.xyz, H2.xyz);
- Hatch = lerp( hatch2, Hatch, level2 );
-
- half level3 = saturate(half(step)-0.5*8);
- half hatch3 = 1- AllHatch.z; //1-dot(AllHatch, H3);
- Hatch = lerp( hatch3, Hatch, level3 );
-
- half level4 = saturate(half(step)-0.375*8);
- half hatch4 = 1- AllHatch.w; //1-dot(AllHatch, H4);
- Hatch = lerp( hatch4, Hatch, level4 );
-
- half level5 = saturate(half(step)-0.25*8);
- half hatch5 = 1-dot(AllHatch, H5);
- Hatch = lerp( hatch5, Hatch, level5 );
-
- Color.rgb += Hatch;
-
- half level6 = saturate(half(step)-0.125*8);
- /*
- half hatch6 = 1-dot(AllHatch, H6);
- Color.rgb = lerp( hatch6, Color.rgb, level6 );
- */
- Color.rgb *= saturate(level6);
- return Color;
- }
-
- ")
-
-